package day20171109;

import java.util.*;

/**
 * Created by Administrator on 2017-11-9.
 */
public class Test2 {

    public static void main(String[] args) {

        int[] numbers = new int[50];
        numbers[0] = 1;
        numbers[1] = 1;
        numbers[2] = 1;

        // 集合

        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        list.add(2);
        list.add(2);
        list.add(3);

        System.out.println(" list result ");
        for (Integer i : list){

            System.out.println(i);
        }

        Set<Integer> set = new HashSet<>();
        set.add(1);
        set.add(2);
        set.add(2);
        set.add(3);

        System.out.println(" set result ");
        for (Integer i : set){
            System.out.println(i);
        }


        // Map
        /***
         * key    value
         * 学号   姓名
         * 1001   chen   -- entry
         * 1002   zhen
         * 1003   zhangsan
         *
         */
        Map<Integer, String> map = new HashMap<>();
        map.put(1001, "chen");
        map.put(1002, "zhen");
        map.put(1003, "zhangsan");

        for (Map.Entry<Integer, String> entry : map.entrySet()){

            System.out.println(entry.getKey());
            System.out.println(entry.getValue());
        }


    }
}
